package com.farah.lease.web.app.controller.slideshow;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.farah.lease.common.result.Result;
import com.farah.lease.model.entity.SlideshowInfo;
import com.farah.lease.web.app.service.SlideshowInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 不爱跑步的法拉韶
 * @Date 2024-07-04__10:30
 **/
@RestController
@Tag(name = "轮播图信息")
@RequestMapping("/app/slideshow")
public class SlideshowInfoController {
    @Autowired
    private SlideshowInfoService slideshowInfoService;
    //根据分类id获取轮播图信息
    @Operation(summary = "根据分类id获取轮播图信息")
    @GetMapping("getSlideshowInfo")
    public Result<List<SlideshowInfo>> getSlideshowInfoByTypeId(Long id) {
        LambdaQueryWrapper<SlideshowInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(SlideshowInfo::getTypeId,id);
        List<SlideshowInfo> list=slideshowInfoService.list(lambdaQueryWrapper);
        return Result.ok(list);
    }

}
